<template>
  <div>
    <h2>Movie</h2>
    <h3>Count组件中num的值是{{num}}</h3>
    <h3>Count组件中addNum的值是:{{ addNum}}</h3>
  </div>
</template>

<script>
import {mapState,mapGetters} from "vuex"
export default {
    name:"Movie",
    // computed:{
    //   num(){
    //     return this.$store.state.num;
    //   }
    // }
    
    // 将store 中的 getter 映射到局部计算属性
    computed:mapState({
      ...mapState(["num"]),
      ...mapGetters(["addNum"])
    }),
    mounted() {
      console.log(this.$store);
    },
}
</script>

<style>

</style>